home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / ctgsen.z / ctgsen
Encoding:
Text File  |  2002-10-03  |  16.6 KB  |  463 lines

  1.  
  2.  
  3.  
  4. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CTGSEN - reorder the generalized Schur decomposition of a complex matrix
  10.      pair (A, B) (in terms of an unitary equivalence trans- formation Q' * (A,
  11.      B) * Z), so that a selected cluster of eigenvalues appears in the leading
  12.      diagonal blocks of the pair (A,B)
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      SUBROUTINE CTGSEN( IJOB, WANTQ, WANTZ, SELECT, N, A, LDA, B, LDB, ALPHA,
  16.                         BETA, Q, LDQ, Z, LDZ, M, PL, PR, DIF, WORK, LWORK,
  17.                         IWORK, LIWORK, INFO )
  18.  
  19.          LOGICAL        WANTQ, WANTZ
  20.  
  21.          INTEGER        IJOB, INFO, LDA, LDB, LDQ, LDZ, LIWORK, LWORK, M, N
  22.  
  23.          REAL           PL, PR
  24.  
  25.          LOGICAL        SELECT( * )
  26.  
  27.          INTEGER        IWORK( * )
  28.  
  29.          REAL           DIF( * )
  30.  
  31.          COMPLEX        A( LDA, * ), ALPHA( * ), B( LDB, * ), BETA( * ), Q(
  32.                         LDQ, * ), WORK( * ), Z( LDZ, * )
  33.  
  34. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  35.      These routines are part of the SCSL Scientific Library and can be loaded
  36.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  37.      directs the linker to use the multi-processor version of the library.
  38.  
  39.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  40.      4 bytes (32 bits). Another version of SCSL is available in which integers
  41.      are 8 bytes (64 bits).  This version allows the user access to larger
  42.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  43.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  44.      only one of the two versions; 4-byte integer and 8-byte integer library
  45.      calls cannot be mixed.
  46.  
  47. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  48.      CTGSEN reorders the generalized Schur decomposition of a complex matrix
  49.      pair (A, B) (in terms of an unitary equivalence trans- formation Q' * (A,
  50.      B) * Z), so that a selected cluster of eigenvalues appears in the leading
  51.      diagonal blocks of the pair (A,B). The leading columns of Q and Z form
  52.      unitary bases of the corresponding left and right eigenspaces (deflating
  53.      subspaces). (A, B) must be in generalized Schur canonical form, that is,
  54.      A and B are both upper triangular.
  55.  
  56.      CTGSEN also computes the generalized eigenvalues
  57.  
  58.               w(j)= ALPHA(j) / BETA(j)
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      of the reordered matrix pair (A, B).
  75.  
  76.      Optionally, the routine computes estimates of reciprocal condition
  77.      numbers for eigenvalues and eigenspaces. These are Difu[(A11,B11),
  78.      (A22,B22)] and Difl[(A11,B11), (A22,B22)], i.e. the separation(s) between
  79.      the matrix pairs (A11, B11) and (A22,B22) that correspond to the selected
  80.      cluster and the eigenvalues outside the cluster, resp., and norms of
  81.      "projections" onto left and right eigenspaces w.r.t.  the selected
  82.      cluster in the (1,1)-block.
  83.  
  84.  
  85.  
  86. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  87.      IJOB    (input) integer
  88.              Specifies whether condition numbers are required for the cluster
  89.              of eigenvalues (PL and PR) or the deflating subspaces (Difu and
  90.              Difl):
  91.              =0: Only reorder w.r.t. SELECT. No extras.
  92.              =1: Reciprocal of norms of "projections" onto left and right
  93.              eigenspaces w.r.t. the selected cluster (PL and PR).  =2: Upper
  94.              bounds on Difu and Difl. F-norm-based estimate
  95.              (DIF(1:2)).
  96.              =3: Estimate of Difu and Difl. 1-norm-based estimate
  97.              (DIF(1:2)).  About 5 times as expensive as IJOB = 2.  =4: Compute
  98.              PL, PR and DIF (i.e. 0, 1 and 2 above): Economic version to get
  99.              it all.  =5: Compute PL, PR and DIF (i.e. 0, 1 and 3 above)
  100.  
  101.      WANTQ   (input) LOGICAL
  102.  
  103.      WANTZ   (input) LOGICAL
  104.  
  105.      SELECT  (input) LOGICAL array, dimension (N)
  106.              SELECT specifies the eigenvalues in the selected cluster. To
  107.              select an eigenvalue w(j), SELECT(j) must be set to
  108.  
  109.      N       (input) INTEGER
  110.              The order of the matrices A and B. N >= 0.
  111.  
  112.      A       (input/output) COMPLEX array, dimension(LDA,N)
  113.              On entry, the upper triangular matrix A, in generalized Schur
  114.              canonical form.  On exit, A is overwritten by the reordered
  115.              matrix A.
  116.  
  117.      LDA     (input) INTEGER
  118.              The leading dimension of the array A. LDA >= max(1,N).
  119.  
  120.      B       (input/output) COMPLEX array, dimension(LDB,N)
  121.              On entry, the upper triangular matrix B, in generalized Schur
  122.              canonical form.  On exit, B is overwritten by the reordered
  123.              matrix B.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      LDB     (input) INTEGER
  141.              The leading dimension of the array B. LDB >= max(1,N).
  142.  
  143.      ALPHA   (output) COMPLEX array, dimension (N)
  144.              BETA    (output) COMPLEX array, dimension (N) The diagonal
  145.              elements of A and B, respectively, when the pair (A,B) has been
  146.              reduced to generalized Schur form.  ALPHA(i)/BETA(i) i=1,...,N
  147.              are the generalized eigenvalues.
  148.  
  149.      Q       (input/output) COMPLEX array, dimension (LDQ,N)
  150.              On entry, if WANTQ = .TRUE., Q is an N-by-N matrix.  On exit, Q
  151.              has been postmultiplied by the left unitary transformation matrix
  152.              which reorder (A, B); The leading M columns of Q form orthonormal
  153.              bases for the specified pair of left eigenspaces (deflating
  154.              subspaces).  If WANTQ = .FALSE., Q is not referenced.
  155.  
  156.      LDQ     (input) INTEGER
  157.              The leading dimension of the array Q. LDQ >= 1.  If WANTQ =
  158.              .TRUE., LDQ >= N.
  159.  
  160.      Z       (input/output) COMPLEX array, dimension (LDZ,N)
  161.              On entry, if WANTZ = .TRUE., Z is an N-by-N matrix.  On exit, Z
  162.              has been postmultiplied by the left unitary transformation matrix
  163.              which reorder (A, B); The leading M columns of Z form orthonormal
  164.              bases for the specified pair of left eigenspaces (deflating
  165.              subspaces).  If WANTZ = .FALSE., Z is not referenced.
  166.  
  167.      LDZ     (input) INTEGER
  168.              The leading dimension of the array Z. LDZ >= 1.  If WANTZ =
  169.              .TRUE., LDZ >= N.
  170.  
  171.      M       (output) INTEGER
  172.              The dimension of the specified pair of left and right
  173.              eigenspaces, (deflating subspaces) 0 <= M <= N.
  174.  
  175.              PL, PR  (output) REAL If IJOB = 1, 4 or 5, PL, PR are lower
  176.              bounds on the reciprocal  of the norm of "projections" onto left
  177.              and right eigenspace with respect to the selected cluster.  0 <
  178.              PL, PR <= 1.  If M = 0 or M = N, PL = PR  = 1.  If IJOB = 0, 2 or
  179.              3 PL, PR are not referenced.
  180.  
  181.      DIF     (output) REAL array, dimension (2).
  182.              If IJOB >= 2, DIF(1:2) store the estimates of Difu and Difl.
  183.              If IJOB = 2 or 4, DIF(1:2) are F-norm-based upper bounds on
  184.              Difu and Difl. If IJOB = 3 or 5, DIF(1:2) are 1-norm-based
  185.              estimates of Difu and Difl, computed using reversed communication
  186.              with CLACON.  If M = 0 or N, DIF(1:2) = F-norm([A, B]).  If IJOB
  187.              = 0 or 1, DIF is not referenced.
  188.  
  189.      WORK    (workspace/output) COMPLEX array, dimension (LWORK)
  190.              IF IJOB = 0, WORK is not referenced.  Otherwise, on exit, if INFO
  191.              = 0, WORK(1) returns the optimal LWORK.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      LWORK   (input) INTEGER
  207.              The dimension of the array WORK. LWORK >=  1 If IJOB = 1, 2 or 4,
  208.              LWORK >=  2*M*(N-M) If IJOB = 3 or 5, LWORK >=  4*M*(N-M)
  209.  
  210.              If LWORK = -1, then a workspace query is assumed; the routine
  211.              only calculates the optimal size of the WORK array, returns this
  212.              value as the first entry of the WORK array, and no error message
  213.              related to LWORK is issued by XERBLA.
  214.  
  215.      IWORK   (workspace/output) INTEGER array, dimension (LIWORK)
  216.              IF IJOB = 0, IWORK is not referenced.  Otherwise, on exit, if
  217.              INFO = 0, IWORK(1) returns the optimal LIWORK.
  218.  
  219.      LIWORK  (input) INTEGER
  220.              The dimension of the array IWORK. LIWORK >= 1.  If IJOB = 1, 2 or
  221.              4, LIWORK >=  N+2; If IJOB = 3 or 5, LIWORK >= MAX(N+2, 2*M*(N-
  222.              M));
  223.  
  224.              If LIWORK = -1, then a workspace query is assumed; the routine
  225.              only calculates the optimal size of the IWORK array, returns this
  226.              value as the first entry of the IWORK array, and no error message
  227.              related to LIWORK is issued by XERBLA.
  228.  
  229.      INFO    (output) INTEGER
  230.              =0: Successful exit.
  231.              <0: If INFO = -i, the i-th argument had an illegal value.
  232.              =1: Reordering of (A, B) failed because the transformed matrix
  233.              pair (A, B) would be too far from generalized Schur form; the
  234.              problem is very ill-conditioned.  (A, B) may have been partially
  235.              reordered.  If requested, 0 is returned in DIF(*), PL and PR.
  236.  
  237. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  238.      CTGSEN first collects the selected eigenvalues by computing unitary U and
  239.      W that move them to the top left corner of (A, B). In other words, the
  240.      selected eigenvalues are the eigenvalues of (A11, B11) in
  241.  
  242.                    U'*(A, B)*W = (A11 A12) (B11 B12) n1
  243.                                  ( 0  A22),( 0  B22) n2
  244.                                    n1  n2    n1  n2
  245.  
  246.      where N = n1+n2 and U' means the conjugate transpose of U. The first n1
  247.      columns of U and W span the specified pair of left and right eigenspaces
  248.      (deflating subspaces) of (A, B).
  249.  
  250.      If (A, B) has been obtained from the generalized real Schur decomposition
  251.      of a matrix pair (C, D) = Q*(A, B)*Z', then the reordered generalized
  252.      Schur form of (C, D) is given by
  253.  
  254.               (C, D) = (Q*U)*(U'*(A, B)*W)*(Z*W)',
  255.  
  256.      and the first n1 columns of Q*U and Z*W span the corresponding deflating
  257.      subspaces of (C, D) (Q and Z store Q*U and Z*W, resp.).
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      Note that if the selected eigenvalue is sufficiently ill-conditioned,
  273.      then its value may differ significantly from its value before reordering.
  274.  
  275.      The reciprocal condition numbers of the left and right eigenspaces
  276.      spanned by the first n1 columns of U and W (or Q*U and Z*W) may be
  277.      returned in DIF(1:2), corresponding to Difu and Difl, resp.
  278.  
  279.      The Difu and Difl are defined as:
  280.  
  281.           Difu[(A11, B11), (A22, B22)] = sigma-min( Zu )
  282.      and
  283.           Difl[(A11, B11), (A22, B22)] = Difu[(A22, B22), (A11, B11)],
  284.  
  285.      where sigma-min(Zu) is the smallest singular value of the (2*n1*n2)-by-
  286.      (2*n1*n2) matrix
  287.  
  288.           Zu = [ kron(In2, A11)  -kron(A22', In1) ]
  289.                [ kron(In2, B11)  -kron(B22', In1) ].
  290.  
  291.      Here, Inx is the identity matrix of size nx and A22' is the transpose of
  292.      A22. kron(X, Y) is the Kronecker product between the matrices X and Y.
  293.  
  294.      When DIF(2) is small, small changes in (A, B) can cause large changes in
  295.      the deflating subspace. An approximate (asymptotic) bound on the maximum
  296.      angular error in the computed deflating subspaces is
  297.  
  298.           EPS * norm((A, B)) / DIF(2),
  299.  
  300.      where EPS is the machine precision.
  301.  
  302.      The reciprocal norm of the projectors on the left and right eigenspaces
  303.      associated with (A11, B11) may be returned in PL and PR.  They are
  304.      computed as follows. First we compute L and R so that P*(A, B)*Q is block
  305.      diagonal, where
  306.  
  307.           P = ( I -L ) n1           Q = ( I R ) n1
  308.               ( 0  I ) n2    and        ( 0 I ) n2
  309.                 n1 n2                    n1 n2
  310.  
  311.      and (L, R) is the solution to the generalized Sylvester equation
  312.  
  313.           A11*R - L*A22 = -A12
  314.           B11*R - L*B22 = -B12
  315.  
  316.      Then PL = (F-norm(L)**2+1)**(-1/2) and PR = (F-norm(R)**2+1)**(-1/2).  An
  317.      approximate (asymptotic) bound on the average absolute error of the
  318.      selected eigenvalues is
  319.  
  320.           EPS * norm((A, B)) / PL.
  321.  
  322.      There are also global error bounds which valid for perturbations up to a
  323.      certain restriction:  A lower bound (x) on the smallest F-norm(E,F) for
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  335.  
  336.  
  337.  
  338.      which an eigenvalue of (A11, B11) may move and coalesce with an
  339.      eigenvalue of (A22, B22) under perturbation (E,F), (i.e. (A + E, B + F),
  340.      is
  341.  
  342.       x = min(Difu,Difl)/((1/(PL*PL)+1/(PR*PR))**(1/2)+2*max(1/PL,1/PR)).
  343.  
  344.      An approximate bound on x can be computed from DIF(1:2), PL and PR.
  345.  
  346.      If y = ( F-norm(E,F) / x) <= 1, the angles between the perturbed (L', R')
  347.      and unperturbed (L, R) left and right deflating subspaces associated with
  348.      the selected cluster in the (1,1)-blocks can be bounded as
  349.  
  350.       max-angle(L, L') <= arctan( y * PL / (1 - y * (1 - PL * PL)**(1/2))
  351.       max-angle(R, R') <= arctan( y * PR / (1 - y * (1 - PR * PR)**(1/2))
  352.  
  353.      See LAPACK User's Guide section 4.11 or the following references for more
  354.      information.
  355.  
  356.      Note that if the default method for computing the Frobenius-norm- based
  357.      estimate DIF is not wanted (see CLATDF), then the parameter IDIFJB (see
  358.      below) should be changed from 3 to 4 (routine CLATDF (IJOB = 2 will be
  359.      used)). See CTGSYL for more details.
  360.  
  361.      Based on contributions by
  362.         Bo Kagstrom and Peter Poromaa, Department of Computing Science,
  363.         Umea University, S-901 87 Umea, Sweden.
  364.  
  365.      References
  366.      ==========
  367.  
  368.      [1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the
  369.          Generalized Real Schur Form of a Regular Matrix Pair (A, B), in
  370.          M.S. Moonen et al (eds), Linear Algebra for Large Scale and
  371.          Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.
  372.  
  373.      [2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified
  374.          Eigenvalues of a Regular Matrix Pair (A, B) and Condition
  375.          Estimation: Theory, Algorithms and Software, Report
  376.          UMINF - 94.04, Department of Computing Science, Umea University,
  377.          S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87.
  378.          To appear in Numerical Algorithms, 1996.
  379.  
  380.      [3] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software
  381.          for Solving the Generalized Sylvester Equation and Estimating the
  382.          Separation between Regular Matrix Pairs, Report UMINF - 93.23,
  383.          Department of Computing Science, Umea University, S-901 87 Umea,
  384.          Sweden, December 1993, Revised April 1994, Also as LAPACK working
  385.          Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1,
  386.          1996.
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))                                                          CCCCTTTTGGGGSSSSEEEENNNN((((3333SSSS))))
  401.  
  402.  
  403.  
  404. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  405.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  406.  
  407.      This man page is available only online.
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.